package com.hailin.picviewer;


import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;



public class MainForm extends Form implements CommandListener{

    private Command cmdPre = new Command("pre",
            Command.SCREEN, 0);

    private Command cmdNext = new Command("next",
            Command.SCREEN, 0);

    private static MainForm instance = null;

    public static synchronized MainForm getMainForm() {
        if (instance == null) {
            instance = new MainForm("pic viewer");
            instance.initSelf();
        }
        return instance;
    }

    public MainForm(String title) {
        super(title);
    }

    private void initSelf() {
        this.addCommand(cmdPre);
        this.addCommand(cmdNext);
        this.setCommandListener(this);
    }

    public void commandAction(Command command, Displayable displayable) {
        if (command == cmdPre) {
            
        } else if (command == cmdNext) {
            
        }
    }

   

}
